package com.yiliao.control;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yiliao.service.PayDeployService;
import com.yiliao.util.MessageUtil;

@Controller
@RequestMapping("admin")
public class PayDeployControl {

	@Autowired
	PayDeployService payDeployService;
	/**
	 * 获取支付配置列表
	 * @param page
	 * @return
	 */
	@RequestMapping(value= {"getPayDeployList"},method = RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> getPayDeployList(int page) {
		
		return payDeployService.getPayDeployList(page);
	}
	
	/**
	 * 添加或者修改支付渠道
	 * @param t_id
	 * @param payName
	 * @param isDefault
	 * @param isScrap
	 * @param payType
	 * @return
	 */
	@RequestMapping(value = {"addOrPayDeploy"} ,method = RequestMethod.POST)
	@ResponseBody
	public MessageUtil addOrPayDeploy(Integer t_id,String payName,int isDefault,int isScrap,int payType) {
		
		return payDeployService.addOrPayDeploy(t_id, payName, isDefault, isScrap, payType);
	}
	
	
	/**
	 * 删除数据
	 * @param t_id
	 * @return
	 */
	@RequestMapping(value= {"delPayDeploy"},method = RequestMethod.POST)
	@ResponseBody
	public MessageUtil delPayDeploy(int t_id) {
		
		return payDeployService.delPayDeploy(t_id);
	}
	
}
